.ui-widget,
.ui-widget * {
  box-sizing: border-box;
}

.f-primeng-treetable {
  .ui-treetable {
    position: relative;
  }

  .ui-treetable table {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
  }

  .ui-treetable .ui-sortable-column {
    cursor: pointer;
    user-select: none;
  }

  .ui-treetable p-treetablesorticon {
    vertical-align: middle;
    position: absolute;
    right: 0.5rem;
    top: 50%;
    margin-top: -9px;

    .pi-fw {
      width: 1em;
      height: 1em;
      line-height: 1rem;
      font-size: 16px;
    }

    .pi-sort::before {
      font-family: FarrisIcons;
      display: inline-block;
      text-align: center;
      content: "\eb85";
    }

    .pi-sort-up::before {
      font-family: FarrisIcons;
      display: inline-block;
      text-align: center;
      content: "\eb86";
    }

    .pi-sort-down::before {
      font-family: FarrisIcons;
      display: inline-block;
      text-align: center;
      content: "\eb87";
    }
  }

  .ui-treetable-auto-layout>.ui-treetable-wrapper {
    overflow-x: auto;
  }

  .ui-treetable-auto-layout>.ui-treetable-wrapper>table {
    table-layout: auto;
  }

  .ui-treetable .ui-treetable-chkbox {
    vertical-align: middle;
    display: inline-block;

    .ui-chkbox-box {
      margin-right: 0.5rem;
      text-align: center;

      .ui-chkbox-icon {
        overflow: hidden;
        position: relative;
        font-size: 15px;
      }
    }


    .ui-chkbox-icon {
      width: 1em;
      height: 1em;
      font-family: FarrisIcons;
      line-height: 1;
      display: block;
      color: #d9d9d9;

      &::before {
        font-family: FarrisIcons;
        content: '\e304';
        line-height: 1;
        font-size: 14px;
        display: block;
      }
    }

    .ui-chkbox-box.ui-state-active .ui-chkbox-icon {
      color: #2A87FF;

      &::before {
        content: '\e305';
      }
    }
  }

  .ui-treetable-caption,
  .ui-treetable-summary {
    padding: .25em .5em;
    text-align: center;
    font-weight: bold;
  }

  .ui-treetable-caption {
    border-bottom: 0 none;
  }

  .ui-treetable-summary {
    border-top: 0 none;
  }


  .ui-treetable .ui-paginator-top {
    border-bottom: 0 none;
  }

  .ui-treetable .ui-paginator-bottom {
    border-top: 0 none;
  }

  .ui-treetable-scrollable-wrapper {
    position: relative;
  }

  .ui-treetable-scrollable-header,
  .ui-treetable-scrollable-footer {
    overflow: hidden;
    border: 0 none;
  }

  .ui-treetable-scrollable-body {
    overflow: auto;
    position: relative;
  }

  .ui-treetable-scrollable-body>table>.ui-treetable-tbody>tr:first-child>td {
    border-top: 0 none;
  }

  .ui-treetable-flex-scrollable {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
  }

  .ui-treetable-flex-scrollable .ui-treetable-scrollable-wrapper,
  .ui-treetable-flex-scrollable .ui-treetable-scrollable-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
  }

  .ui-treetable-flex-scrollable .ui-treetable-scrollable-body,
  .ui-treetable-flex-scrollable .ui-treetable-virtual-scrollable-body {
    flex: 1;
  }

  .ui-treetable-frozen-view .ui-treetable-scrollable-body {
    overflow: hidden;
  }

  .ui-treetable-frozen-view>.ui-treetable-scrollable-body>table>.ui-treetable-tbody>tr>td:last-child {
    border-right: 0 none;
  }

  .ui-treetable-unfrozen-view {
    position: absolute;
    top: 0px;
  }

  .ui-treetable-resizable>.ui-treetable-wrapper {
    overflow-x: auto;
  }

  .ui-treetable-resizable .ui-treetable-thead>tr>th,
  .ui-treetable-resizable .ui-treetable-tfoot>tr>td,
  .ui-treetable-resizable .ui-treetable-tbody>tr>td {
    overflow: hidden;
  }

  .ui-treetable-resizable .ui-resizable-column {
    background-clip: padding-box;
    position: relative;
  }

  .ui-treetable-resizable-fit .ui-resizable-column:last-child .ui-column-resizer {
    display: none;
  }

  .ui-treetable .ui-column-resizer {
    display: block;
    position: absolute !important;
    top: 0;
    right: 1px;
    margin: 0;
    width: .5em;
    height: 100%;
    padding: 0px;
    cursor: e-resize;
    border-right: 3px solid transparent;
  }

  .ui-treetable .ui-resizable-column:hover .ui-column-resizer {
    border-right-color: #1E80FF
  }

  .ui-treetable .ui-column-resizer-helper {
    width: 1px;
    position: absolute;
    z-index: 10;
    display: none;
  }

  .ui-treetable-reorder-indicator-up,
  .ui-treetable-reorder-indicator-down {
    position: absolute;
    display: none;
  }

  .ui-treetable-responsive .ui-treetable-tbody>tr>td .ui-column-title {
    display: none;
  }

  @media screen and (max-width: 40em) {

    .ui-treetable-responsive .ui-treetable-thead>tr>th,
    .ui-treetable-responsive .ui-treetable-tfoot>tr>td {
      display: none !important;
    }

    .ui-treetable-responsive .ui-treetable-tbody>tr>td {
      text-align: left;
      display: block;
      border: 0 none;
      width: 100% !important;
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      box-sizing: border-box;
      float: left;
      clear: left;
    }

    .ui-treetable-responsive .ui-treetable-tbody>tr>td .ui-column-title {
      padding: .4em;
      min-width: 30%;
      display: inline-block;
      margin: -.4em 1em -.4em -.4em;
      font-weight: bold;
    }
  }

  .ui-treetable-loading {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    z-index: 1;
  }

  .ui-treetable-loading-content {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    margin-top: -1em;
    margin-left: -1em;
  }

  .ui-treetable .ui-treetable-loading-icon {
    font-size: 2em;
  }

  .ui-virtualscroller .ui-virtualscroller-header {
    text-align: center;
    padding: .5em .75em;
    border-bottom: 0 none;
  }

  .ui-virtualscroller .ui-virtualscroller-footer {
    text-align: center;
    padding: .25em .625em;
    border-top: 0px none;
  }

  .ui-virtualscroller .ui-virtualscroller-list {
    list-style-type: none;
    margin: 0;
    padding: 0;
  }

  .ui-treetable .ui-treetable-caption,
  .ui-treetable .ui-treetable-summary {
    background-color: #f4f4f4;
    color: #333333;
    border: 1px solid #c8c8c8;
    padding: 0.571em 1em;
    text-align: center;
  }

  .ui-treetable .ui-treetable-caption {
    border-bottom: 0 none;
    font-weight: 700;
  }

  .ui-treetable .ui-treetable-summary {
    border-top: 0 none;
    font-weight: 700;
  }



  .ui-treetable .ui-treetable-thead {
    color: $farris-grid-header-text;
    background-color: $farris-grid-header-bg;

    th {
      padding: $f-grid-header-cell-padding-y 0.75rem;
      line-height: 1.25rem;
      border-width: 0 0 $farris-grid-cell-horizontal-border-width 0;
      font-weight: $farris-grid-header-font-weight;
      border-color: $farris-grid-header-border;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      position: relative;

      &::after {
        content: '';
        position: absolute;
        right: 0;
        top: 50%;
        margin-top: calc(-#{$f-grid-header-cell-line-height} / 2);
        display: block;
        height: $f-grid-header-cell-line-height;
        width: 1px;
        background-color: $farris-grid-header-splitter-color;
      }

      &:last-child::after {
        display: none;
      }
    }

  }

  .ui-treetable .ui-treetable-tbody>tr {
    border-bottom: $farris-grid-cell-horizontal-border-width solid $farris-grid-border;
    //newStyle
    border-color: $f-table-border-color;

    &:nth-of-type(#{$f-table-striped-order}) {
      background-color: $f-table-accent-bg;
    }

    &.ui-state-highlight {
      border-color: $farris-grid-selected-border;
      color: $farris-grid-selected-text;
      background-color: $farris-grid-selected-bg;
    }

    td {

      padding: $f-grid-cell-padding-y $f-table-cell-padding;
      height: $farris-table-td-height;
      line-height: 1.25rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .ui-editing-cell {
      display: flex;
      flex-direction: row;
      padding-top: 1px;
      padding-bottom: 1px;
      align-items: center;
      height: auto;
    }

  }


  .ui-treetable .ui-treetable-toggler {
    display: inline-block;
    position: relative;
    cursor: pointer;
    width: 0.875rem;
    height: 0.875rem;
    font-size: 0.75rem;
    line-height: 0.75rem;
    margin: 0 0.375rem 0 0;
    background: #fff;
    border: 1px solid $f-neutral-02;
    border-radius: 2px;
    text-align: center;

    &:hover {
      border-color: $f-theme-05;

      .pi::before {
        color: $f-theme-05;
      }
    }

    &:active {
      border-color: $f-theme-03;

      &::before {
        color: $f-theme-03;
      }
    }
  }

  .ui-treetable .ui-sortable-column {
    -moz-transition: box-shadow 0.2s;
    -o-transition: box-shadow 0.2s;
    -webkit-transition: box-shadow 0.2s;
    transition: box-shadow 0.2s;
  }

  .ui-treetable .ui-sortable-column:focus {
    outline: 0 none;
    outline-offset: 0;
  }

  .ui-treetable .ui-sortable-column .ui-sortable-column-icon {
    color: $f-text-08;
  }

  .ui-treetable .ui-sortable-column:hover {
    background-color: $farris-grid-selected-bg;
    color: $farris-grid-header-text;
  }

  .ui-treetable .ui-sortable-column:hover .ui-sortable-column-icon {
    color: $f-theme-03;
  }

  .ui-treetable .ui-treetable-tbody>tr {
    background-color: #ffffff;
    color: #333333;
  }

  .ui-treetable .ui-treetable-tbody>tr>td {
    -moz-transition: box-shadow 0.2s;
    -o-transition: box-shadow 0.2s;
    -webkit-transition: box-shadow 0.2s;
    transition: box-shadow 0.2s;
  }

  .ui-treetable .ui-treetable-tbody>tr>td .ui-treetable-chkbox {
    vertical-align: middle;
    margin-right: 0.5em;
  }


  .ui-treetable .ui-treetable-tbody>tr:focus {
    outline: none;
  }


  .ui-treetable.ui-treetable-hoverable-rows .ui-treetable-tbody>tr:not(.ui-state-highlight):hover {
    cursor: pointer;
    background-color: $farris-grid-hovered-bg;
    color: $farris-grid-hovered-text;
    border-color: $farris-grid-border;
  }

  .ui-treetable .ui-column-resizer-helper {
    border-left: 1px dashed #007ad9;
  }

  .ui-virtualscroller .ui-virtualscroller-header {
    background-color: #f4f4f4;
    color: #333333;
    border: 1px solid #c8c8c8;
    padding: 0.571em 1em;
    font-weight: 700;
    border-bottom: 0 none;
  }

  .ui-virtualscroller .ui-virtualscroller-content {
    border: 1px solid #c8c8c8;
    background-color: #ffffff;
    color: #333333;
  }

  .ui-virtualscroller .ui-virtualscroller-content .ui-virtualscroller-list .ui-virtualscroller-item {
    border-bottom: 1px solid #d8dae2;
  }

  .ui-virtualscroller .ui-virtualscroller-footer {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #c8c8c8;
    padding: 0.571em 1em;
    border-top: 0 none;
  }

  .pi {
    font-family: 'primeicons';
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    display: inline-block;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .pi-fw {
    width: 1.28571429em;
    text-align: center;
  }

  p-treetabletoggler {
    display: inline-block;
    line-height: 1;
    height: 14px;
  }

  .ui-treetable-toggler {
    .pi-fw {
      width: 1em;
      height: 1em;
      font-size: 12px;
    }

    .pi-chevron-down {
      &::before {
        font-family: 'FarrisIcons';
        color: $f-text-02;
        content: '\e121';
        line-height: 1;
      }
    }

    // 收起
    .pi-chevron-right {
      &::before {
        font-family: 'FarrisIcons';
        color: $f-text-02;
        content: '\e11e';
        line-height: 1;
      }
    }
  }


  .ui-helper-hidden-accessible {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
  }

}

.ui-treetable-table .ui-editing-cell .k-textarea.form-control {
  width: 100%;
}

/* 使编辑器居中并铺满 */
.f-primeng-treetable .ui-treetable .ui-treetable-tbody>tr .ui-editing-cell p-treetablecelleditor {
  display: inline-block;
  width: 100%;
  flex-grow: 1;
}